//package com.huangyi;
//
//import org.springframework.cloud.gateway.filter.GatewayFilterChain;
//import org.springframework.cloud.gateway.filter.GlobalFilter;
//import org.springframework.core.Ordered;
//import org.springframework.stereotype.Component;
//import reactor.core.publisher.Mono;
//
//@Component
//public class LoggingGlobalFilter implements GlobalFilter, Ordered {
//
//    @Override
//    public Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, GatewayFilterChain chain) {
//        // 记录请求信息：路径、方法等
//        String path = exchange.getRequest().getPath().toString();
//        String method = exchange.getRequest().getMethod().name();
//        System.out.println("GlobalFilter applied - Request: " + method + " " + path);
//
//        // 继续执行过滤器链
//        return chain.filter(exchange);
//    }
//
//    @Override
//    public int getOrder() {
//        // 设置优先级，较低值表示更高优先级（例如，-1 表示早于其他过滤器执行）
//        return -1;
//    }
//}
